# coding:utf-8
from django.conf.urls import patterns, include, url

from django.contrib import admin
admin.autodiscover()

#获取本地目录路径避免不断修改图片地址
import sys,os
#获取脚本文件的当前路径
def cur_file_dir():
     #获取脚本路径
     path = sys.path[0]
     #判断为脚本文件还是py2exe编译后的文件，如果是脚本文件，则返回的是脚本的目录，如果是py2exe编译后的文件，则返回的是编译后的文件路径
     #if os.path.isdir(path):
     return path
     #elif os.path.isfile(path):
     #return os.path.dirname(path)


urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'tools.views.index', name='home'),
    # url(r'^blog/', include('blog.urls')),
    url(r'result/$', 'tools.views.result'),
    url(r'home/$', 'tools.views.index', name='home'),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^site_media/(?P<path>.*)','django.views.static.serve',{'document_root':cur_file_dir()}),
)
